/*----------------------------------------------------------------------------
 * osObjects.h: CMSIS-RTOS global object definitions for an application
 *----------------------------------------------------------------------------
 *
 * This header file defines global RTOS objects used throughout a project
 *
 * #define osObjectsPublic indicates that objects are defined; without that
 * definition the objects are defined as external symbols.
 *
 *--------------------------------------------------------------------------*/


#ifndef __osObjects
#define __osObjects


#ifdef osObjectsCreat
#define OBJ_EXT  
#else
#define OBJ_EXT extern 
#endif

#include "common.h"
#include "FreeRTOS.h"
#include "task.h"               // CMSIS RTOS header file
#include "semphr.h"
#include "event_groups.h"
#include "queue.h"

#define TASK_PRIORITY_BELOW_LOW         (tskIDLE_PRIORITY+1)
#define TASK_PRIORITY_LOW               (TASK_PRIORITY_BELOW_LOW+1)
#define TASK_PRIORITY_ABOVE_LOW         (TASK_PRIORITY_LOW+1)
#define TASK_PRIORITY_BELOW_MIDDLE      (TASK_PRIORITY_ABOVE_LOW+1)
#define TASK_PRIORITY_MIDDLE            (TASK_PRIORITY_BELOW_MIDDLE+1)
#define TASK_PRIORITY_ABOVE_MIDDLE      (TASK_PRIORITY_MIDDLE+1)
#define TASK_PRIORITY_BELOW_HIGH        (TASK_PRIORITY_ABOVE_MIDDLE+1)
#define TASK_PRIORITY_HIGH              (TASK_PRIORITY_BELOW_HIGH+1)
#define TASK_PRIORITY_ABOVE_HIGH        (TASK_PRIORITY_HIGH+1)
#define TASK_PRIORITY_REAL              (TASK_PRIORITY_ABOVE_HIGH+1)


// global 'thread' functions ---------------------------------------------------

int Init_Thread (void);

OBJ_EXT BaseType_t  tid_GuiTask;                                  // thread id

// global 'semaphores' ----------------------------------------------------------

OBJ_EXT xSemaphoreHandle mid_sdcard;
OBJ_EXT xSemaphoreHandle mid_iichal;
OBJ_EXT xSemaphoreHandle mid_malloc;

OBJ_EXT xSemaphoreHandle sid_mbx;
// global 'message queues' -------------------------------------------------------
OBJ_EXT xQueueSetHandle  qid_mbx;


// global 'mail queues' ----------------------------------------------------------


#endif  // __osObjects
